package com.dlwx.firefighting.adapter;

import android.content.Context;
import android.graphics.drawable.Drawable;

import com.dlwx.firefighting.R;
import com.dlwx.firefighting.bean.CommentBean;
import com.dlwx.firefighting.config.Constant;
import com.dlwx.firefighting.utils.SPUtils;


/**
 * Created by Administrator on 2017/6/16.
 */

public class GoodsDetailAdapter extends ListBaseAdapter<CommentBean> {

    private Context context;
    private String userId;
    private boolean isPraise=false;
    Drawable unPraise=null;
    Drawable praise=null;

    public GoodsDetailAdapter(Context context) {
        super(context);
        this.context=context;
        userId= (String) SPUtils.get(context,Constant.USER_ID,"");
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
            unPraise=context.getDrawable(R.mipmap.praise);
            praise=context.getDrawable(R.mipmap.praise_select);
        }else{
            unPraise=context.getResources().getDrawable(R.mipmap.praise);
            praise=context.getResources().getDrawable(R.mipmap.praise_select);
        }
        praise.setBounds(0,0,praise.getIntrinsicWidth(),praise.getIntrinsicHeight());
        unPraise.setBounds(0,0,praise.getIntrinsicWidth(),praise.getIntrinsicHeight());
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_comment;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, final int position) {
    }

}
